<?php slot('studyGroupsNav', 'active') ?>
<div class="courses" id="wrapper">
	<div id="content">
		<div id="main">
			<div class="main-heading">
				
				<!-- 
				<form method="post" action="" id="select-semester">
					<fieldset>
						<label>Network</label>
						<select onchange="window.location = this.value;" id="networkselector" name="network">
							<option value="<?php echo url_for('groups/index') ?>">All</option>
							<?php foreach($networks as $id => $network): ?>
								<option value="<?php echo url_for('groups/index?network_id='.$id) ?>"><?php echo $network ?></option>
							<?php endforeach ?>
						</select>
					</fieldset>
				</form>
				-->
				<?php if($networkname) :?>
					<form method="post" action="" id="select-semester">
						<fieldset><label>Network: <?php echo $networkname ?></label></fieldset>
					</form>
				<?php endif; ?>
				
				<h1>All Groups</h1>
			</div>
			<ul class="filter-links">
				<li class="current">
					<a href="#">Most Popular</a>
				</li>
				<!--<li><a href="#">Most Recent</a></li>-->
			</ul>
			<ul class="courses-list">
				<?php foreach($groups as $group): ?>
				<li>
					<h3>
						<?php echo link_to($group->getName(), 'groups/show?id='.$group->getId()) ?>
					</h3>
					<div class="details">
						<p class="related-users">
						<strong>Members: </strong>
						<?php foreach(GroupMemberPeer::retrieveByGroupId($group->getId()) as $groupMember): ?>
							<?php echo link_to($groupMember->getUser()->getFullName(), 'user_profiles/show?id='.$groupMember->getUser()->getId()) ?>
						<?php endforeach ?>
						<p class="related-users">
							<strong>Network: </strong>
							<?php echo $networks[$group->getNetworkId()] ?>
						</p>
						<p><?php echo $group->getDescription() ?></p>
						<p class="stars three">&nbsp;
							<!--<a href="#">3<span> comments</span></a>-->
						</p>
					</div>
				</li>
				<?php endforeach ?>
			</ul>
		</div>
		<!-- MAIN -->
		<div id="sidebar">
			<?php if($sf_user->isAuthenticated()): ?>
				<?php include_component('groups', 'list')?>
			<?php endif ?>
		</div>
	</div>
</div>
